@extends('admin.base')

@section('title') 添加轮播图 @endsection

@section('caption')
    添加轮播图
@endsection

@section('content')
    <form class="form-horizontal" action="insertslider">
        @csrf
        <div class="row">
            <div class="form-group">
                <label class="control-label col-md-2 text-right">轮播名称</label>
                <div class="col-md-10">
                    <input name="name" type="text" value="{{isset($sliders)?$sliders->name:''}}" class="form-control">
                    <input name="id" type="hidden" value="{{isset($sliders)?$sliders->id:0}}" class="form-control">
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-md-2 text-right">轮播图</label>
                <div class="col-md-10">
                    <input name="slider" type="file" class="file-styled">
                    @if(isset($type)?$type->image:'')
                        <img src="{{isset($type)?$type->image:''}}" style="width: 50px;height: 50px">
                    @endif
                </div>
            </div>


            <div class="form-group">
                <label class="control-label col-md-2 text-right">顺序</label>
                <div class="col-md-10">
                    <input name="order" type="text" class="form-control" value="{{isset($sliders)?$sliders->order:''}}">
                </div>
            </div>
        </div>


        <div class="col-xs-12 no-padding">
            <div class="col-md-6">
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <button type="submit" class="btn btn-primary pr-20 pl-20 mr-10">تاپشۇرۇش</button>
                        <button type="reset" class="btn btn-default pr-20 pl-20 ml-10">تازلاش</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
@endsection

